home *** CD-ROM | disk | FTP | other *** search
/ MacTech 1 to 12 / MacTech-vol-1-12.toast / Source / Peter Lewis (TCPExample) / PNL Libraries / MyTypes.p < prev    next >
Encoding:
Text File  |  1995-11-10  |  3.4 KB  |  164 lines  |  [TEXT/CWIE]

  1. unit MyTypes;
  2.  
  3. { From Peter's PNL Libraries }
  4. { Copyright 1992 Peter N Lewis }
  5. { This source may be used for any non-commercial purposes as long as I get a mention }
  6. { in the About box and Docs of any derivative program.  It may not be used in any commercial }
  7. { application without my permission }
  8.  
  9. interface
  10.  
  11.     uses
  12.         Quickdraw, Events;
  13.  
  14.     const
  15.         inProgress = 1;                            { I/O in progress }
  16.         sysWDProcID = $4552494B;        { 'ERIK' }
  17.         myErr = -5;
  18.         myErr2 = -6;
  19.         cancelErr = myErr2;
  20.         myErr3 = -7;
  21.         noType = 0;                            { should be OSType(0) !!! }
  22.         fsNoCache = $20;
  23.         fsNewLine = $80; { put the newline character in the high byte of ioPosMode }
  24.         bad_rn = 0;
  25.         bad_date = $80000000;
  26.  
  27.     const
  28.         M_Apple = 128;
  29.         M_File = 129;
  30.         M_Edit = 130;
  31.         M_Windows = 150;
  32.  
  33.     const
  34.         CAbout = 'abou';
  35.         CNew = 'new ';
  36.         COpen = 'open';
  37.         CSave = 'save';
  38.         CSaveAs = 'svas';
  39.         CClose = 'clos';
  40.         CPreferences = 'pref';
  41.         CPageSetUp = 'pgsu';
  42.         CPrint = 'prnt';
  43.         CHelp = 'help';
  44.         CQuit = 'quit';
  45.         CUndo = 'undo';
  46.         CCut = 'cut ';
  47.         CCopy = 'copy';
  48.         CPaste = 'past';
  49.         CClear = 'clea';
  50.         CSelectAll = 'sela';
  51.  
  52.     const
  53.         keyOdocOption = 'auto'; { optional parameter to open }
  54.         keyOdocControl = 'autC'; { optional parameter to open }
  55.  
  56.     const                                    { Low Memory Globals }
  57.         curApNameA = $910;
  58.         ticksA = $16A;
  59.         SFSaveDiskA = $214;
  60.         CurDirStoreA = $398;
  61.         bad_refnum = -32768;
  62.  
  63.     const                                    { Other OS constants, probably declared somewhere now }
  64.         kSysEnvironsVersion = 1;
  65.         kOSEvent = osEvt;                {event used by MultiFinder}
  66.         kSuspendResumeMessage = 1;    {high byte of suspend/resume event message}
  67.         kResumeMask = 1;                    {bit of message field for resume vs. suspend}
  68.         kMouseMovedMessage = $FA;    {high byte of mouse-moved event message}
  69.         kNoEvents = 0;                        {no events mask}
  70.  
  71.     const                                    { Constants that aren't normally defined }
  72.         drawCntlMsg = 0;
  73.         testCntlMsg = 1;
  74.         calcCRgnsMsg = 2;
  75.         initCntlMsg = 3;
  76.         dispCntlMsg = 4;
  77.         posCntlMsg = 5;
  78.         thumbCntlMsg = 6;
  79.         dragCntlMsg = 7;
  80.         autoTrackMsg = 8;
  81.  
  82.     const
  83.         EMUndo = 1;
  84.         EMCut = 3;
  85.         EMCopy = 4;
  86.         EMPaste = 5;
  87.         EMClear = 6;
  88.         EMSelectAll = 7;
  89.  
  90.     const
  91.         nulChar = 0;
  92.         homeChar = $01;
  93.         enterChar = $03;
  94.         endChar = $04;
  95.         helpChar = $05;
  96.         backSpaceChar = $08;
  97.         tabChar = $09;
  98.         lfChar = $0A;
  99.         pageUpChar = $0b;
  100.         pageDownChar = $0c;
  101.         crChar = $0D;
  102.         escChar = $1b;
  103.         escKey = $35;
  104.         clearChar = $1b;
  105.         clearKey = $47;
  106.         leftArrowChar = $1c;
  107.         rightArrowChar = $1d;
  108.         upArrowChar = $1e;
  109.         downArrowChar = $1f;
  110.         spaceChar = $20;
  111.         delChar = $7f;
  112.         bulletChar = $a5;
  113.         undoKey = $7a;
  114.         cutKey = $78;
  115.         copyKey = $63;
  116.         pasteKey = $76;
  117.  
  118.     const
  119.         nul = chr(nulChar);
  120.         enter = chr(enterChar);
  121.         bs = chr(backSpaceChar);
  122.         tab = chr(tabChar);
  123.         lf = chr(lfChar);
  124.         cr = chr(crChar);
  125.         leftArrow = chr(leftArrowChar);
  126.         rightArrow = chr(rightArrowChar);
  127.         upArrow = chr(upArrowChar);
  128.         downArrow = chr(downArrowChar);
  129.         esc = chr(escChar);
  130.         spc = chr(spaceChar);
  131.         del = chr(delChar);
  132.  
  133.     type
  134.         integerP = ^integer;
  135.         integerH = ^integerP;
  136.         longIntP = ^longint;
  137.         longIntH = ^longIntP;
  138.         forkType = (no_fork, data_fork, rsrc_fork, both_fork);
  139.         buf255 = packed array[0..255] of char;
  140.         CRLFTypes = (CL_CRLF, CL_CR, CL_LF);
  141.         charSet = set of char;
  142.         short = integer;
  143.         long = longint;
  144.  
  145.     type
  146.         QDGlobalsPtr = ^QDGlobals;
  147.  
  148.     function GetQDGlobals: QDGlobalsPtr;
  149. {$IFC not GENERATINGPOWERPC }
  150.     inline
  151.         $2015, $0480, $0000, $00CA, $2E80;
  152. {$ENDC}
  153.  
  154. implementation
  155.  
  156. {$IFC GENERATINGPOWERPC }
  157.     function GetQDGlobals: QDGlobalsPtr;
  158.     begin
  159.         GetQDGlobals := @qd;
  160.     end;
  161. {$ENDC}
  162.  
  163. end.
  164.